package cmo.neutech.day09.Score;

import cmo.neutech.day09.Score.Student;

import java.util.Random;

public class TextStudent {
    public static void main(String[] args) {
        Random random = new Random();
        Student[] students = new Student[5];
        for(int i=0;i<students.length;i++) {
            int sno = i + 1;
            String name = "Student" + (i + 1);
            String sex = random.nextBoolean() ? "男" : "女";
            int age = 18 + random.nextInt(10);

            double lecture = random.nextDouble() * 100;
            double midExam = random.nextDouble() * 100;
            double finalExam = random.nextDouble() * 100;
            double intproduction = random.nextDouble() * 100;
            double idExam = random.nextDouble() * 100;
            double operationalCapacity = random.nextDouble() * 100;
            double englishWriting = random.nextDouble() * 100;

            int maj = random.nextInt(3);
            switch (maj) {
                case 0:
                    students[i] = new English(sno, name, sex, age, lecture, midExam, finalExam);
                    break;
                case 1:
                    students[i] = new Computer(sno, name, sex, age, operationalCapacity, englishWriting, midExam, finalExam);
                    break;
                case 2:
                    students[i] = new Literature(sno, name, sex, age, lecture, intproduction, idExam, finalExam);
                    break;
            }
        }
            for(Student student : students) {
                student.score = student.getScore();
                System.out.format("学号：%s 姓名：%s 性别：%s 年龄：%d 综合成绩：%.2f%n",student.sno,student.name,student.sex,student.age,student.score);
        }
    }
}
